package refactor.replacesubclasswithfields;

public class Person {
    private boolean isMale;
    private String code;

    public Person(boolean isMale, String code) {
        this.isMale = isMale;
        this.code = code;
    }

    public boolean isMale() {
        return isMale;
    }

    public String getCode() {
        return code;
    }

    public static Person createMale() {
        return new Person(true, "M");
    }

    public static Person createFemale() {
        return new Person(false, "F");
    }
}
